<template>
  <el-form ref="formRef" :model="form" label-position="top" :label-width="140">
    <div class="grid grid-cols-3 gap-x-3 my-3">
      <div>
        <strong>产品验货数量</strong>: {{ form.qa_num }}
      </div>
      <div>
        <strong>良品数量</strong>: {{ form.quality_num }}
      </div>
      <div>
        <strong>不良品数量</strong>: {{ form.reject_num }}
      </div>
    </div>
    <el-form-item label="可入库数量" prop="process_num" :rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
      <el-input-number v-model="form.quality_num" disabled :controls="false" :min="0" :step="1" :precision="0"
        class="w-full" />
    </el-form-item>
  </el-form>
</template>

<script setup>
const props = defineProps({
  modelValue: { type: Object, default: () => ({}) },
  options: { type: Object, default: () => ({}) },
})
const emit = defineEmits(['update:modelValue'])
const form = computed({
  get() {
    return props.modelValue
  },
  set(val) {
    emit('update:modelValue', val)
  }
})
const formRef = ref()
const validate = async () => await formRef?.value.validate(res => res)
defineExpose({ validate })
</script>